<?php foreach ($cities as $key => $value) {?>
<div id="weather<?php echo ucfirst($key) ?>Main"><div id="weather<?php echo ucfirst($key) ?>"><a href="/weather/"><?php if (strval($value['temperature']) != '') {?><?php echo (intval($value['temperature']) > 0 ? '+' : '-') . $value['temperature'] ?><?php } ?></a></div></div>
<?php } ?>